import { Component } from "react";
import {ThemeContext} from "../context/themeContext"
import  "./theme/css/content.scss"

class ageCtrl extends Component{
    // eslint-disable-next-line
    static contextType=ThemeContext;
    btnChange=(val)=>{
        this.context.infChange(val);
    }
    render(){
        return (
            <div className="content-box" style={{backgroundColor:this.context.tm.backgroundColor}}>
                <span style={{color:this.context.tm.fontColor}}>我是内容</span>
                <button onClick={()=>this.btnChange({"fontColor":"#ff0","backgroundColor":"#00f"})}>
                    改变颜色
                </button>
            </div>
        )
    }
    
}
export default ageCtrl;